package cn.rengy.web.framework.shiro.config;

import javax.servlet.FilterChain;

import org.apache.shiro.web.filter.mgt.DefaultFilterChainManager;
import org.apache.shiro.web.filter.mgt.NamedFilterList;
import org.apache.shiro.web.filter.mgt.SimpleNamedFilterList;

public class IFilterChainManager extends DefaultFilterChainManager {

	public FilterChain proxy(FilterChain original, String chainNames) {
    	NamedFilterList configured = new SimpleNamedFilterList(chainNames);
        for(String chainName : chainNames.split(",")) {
            configured.addAll(getChain(chainName));
        }
        return configured.proxy(original);
    }
}
